package pe.edu.pucp.dp1.gui.vista;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import javax.swing.JPanel;

public class MiniMapa extends JPanel {

    private int posX = 0;
    private int posY = 160;

    public MiniMapa() {
        // Add a MouseListener which processes mouse clicks.
//        this.addMouseListener(new MouseAdapter() {
//            public void mouseClicked(MouseEvent e) {
//                // Retrieve the point at which the mouse was clicked.
//                pointClicked = e.getPoint();
//
//                // Repaint the panel.
//                this.repaint();
//            }
//        })
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);

        // Draw background image each time the panel is repainted.
        // g.drawImage(backgroundImage, 0, 0, null);
        // Draw a little square at where the mouse was clicked.
        //g.fillRect(posX, posY, 5, 5);
        g.setColor(Color.ORANGE);
        g.fillRect(posX-3,160-(posY+3),5,5);
        g.setColor(Color.BLACK);
        g.drawRect(posX-3, 160-(posY+3), 5, 5);
    }

    public void setPosX(int posX) {
        this.posX = posX;
    }

    public void setPosY(int posY) {
        this.posY = posY;
    }

}
